package demo1;
/*
class Base {
    public int a=9;
    public int b=99;

}

class Derived extends Base {
    //同名的情况优先看子类自己的
    public int a=88;

    public void method() {
        System.out.println("a = "+super.a+"\nb ="+b);
    }
}

public class Test {
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.method();

    }
}*/
/*
class Base {
    int a = 99;
    public void method() {
        System.out.println("Base::method()");
    }
    public Base(int a){
        this.a = a;
    }
}

class Derived extends Base {
    int a = 199;

    public Derived(int a){
        super(a);
    }

    public void method() {
        System.out.println("Derived::method()");
    }

    public void method2() {
        System.out.println("Derived::method()");
    }

    public void test(){
        System.out.println(super.a);
        System.out.println(this.a);
        System.out.println(a);
        super.method();
        method();
        method2();
    }
}

public class Test{
    public static void main(String[] args) {
        Derived derived = new Derived(2);
        derived.test();
    }
}*/

public class Test{
    protected int a = 1999;
}














